import { Application } from 'egg';

export default (app: Application) => {
  const mongoose = app.mongoose;
  const Schema = mongoose.Schema;
  const userSchema = new Schema({
    username: { type: String, unique: true },
    password: { type: String, required: true },
    createDate: { type: Date },
    lastLoginDate: { type: Date },
  })
  return mongoose.model('user', userSchema);
}
